<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/2/17 0017
 * Time: 上午 9:54
 */

namespace Org\Apply;

abstract class Controller {

    protected $model;
    function __construct($tableName)
    {
        return $this->checkModel($tableName);
    }

    public function checkModel($tableName)
    {
        $rs = M()->query("SHOW TABLES LIKE '".$tableName."'");
        if(!$rs){
            return false;
        } else {
            $this->model = M($tableName);
            return true;
        }
    }
}